﻿#include "faceproject.h"
#include <QApplication>
#include <QApplication>
#include <QSqlDatabase>
#include <QSqlQuery>
#include <QSqlError>
#include <QDebug>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    QSqlDatabase db = QSqlDatabase::addDatabase("QSQLITE");
    db.setDatabaseName("faceInfo.db");
    if(!db.open())
    {
        qDebug()<<db.lastError().text();
        return -1;
    }

    //创建注册表
    QSqlQuery query;
    if(!query.exec("create table if not exists faceInfo(id integer NOT NULL PRIMARY KEY AUTOINCREMENT,"
                   "name varchar(128), "
                   "faceID int unique,"
                   "picturepath varchar(128) unique,signltime varchar(128) ,flage int)"))
    {
        qDebug()<<query.lastError().text();
        return -1;
    }

    faceProject w;
    w.show();

    return a.exec();
}
